#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>

int inverse(int inn)
{
	int tmp = inn;
	int ele = 0;
	while (tmp >= 10)
	{
		ele = ele * 10 + tmp % 10;
		tmp = tmp / 10;
	}
	ele = ele * 10 + tmp;
	return ele;
}

int main()
{
	int n;
	scanf("%d", &n);

	int m;
	while (m = inverse(n), m != n)
	{
		printf("%d ", n);
		n = m + n;
	}
	printf("%d", m);
	return 0;
}